package com.woniu.command.userCommand;

import com.woniu.command.Command;
import com.woniu.command.handler.UserCommandHandler;
import com.woniu.utils.ApplicationContextHolder;

public class DeleteUserCommand implements Command<Integer,Integer> {

    private UserCommandHandler handler;
    public DeleteUserCommand(){
        this.handler = ApplicationContextHolder.getApplicationContext()
                .getBean(UserCommandHandler.class);
    }
    @Override
    public Integer  execute(Integer id) {
        return handler.deleteUserById(id);
    }
}
